<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('拜特薪资信息(所有员工)')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
    <th:block th:include="include :: bootstrap-editable-css"/>
</head>
<body class="gray-bg">
<div class="modal inmodal fade" id="myModal1" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">选择薪资套类型</h4>
            </div>
            <div class="modal-body">
                <p>
                    <select id="pgid" name='pgid' class="form-control">
                    </select>
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" id="missmodal1" class="btn btn-white" data-dismiss="modal">关闭</button>
                <button type="button" onclick="getPgid()" class="btn btn-primary">确认</button>
            </div>
        </div>
    </div>
</div>
<button type="button" id="modal1" class="btn btn-primary" data-toggle="modal"
        data-target="#myModal1">选择薪资套
</button>


<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="user-form">
                    <div class="select-list">
                        <ul>
                            <li>
                                工号：<input type="text" name="badge"/>
                            </li>
                            <li>
                                姓名：<input type="text" name="name"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="bankNumRepeatValidation()">
                    银行卡号重复验证
                </a>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>


<script th:inline="javascript">
    var prefix = ctx + "salaryInfo/btSalaryInfo";
    var pgid;
    var xztList = [];
    $(function () {
        var panehHidden = false;
        if ($(this).width() < 800) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 350});
        $("#modal1").attr("style", "display:none;");
        getSkypayGroups();
        //queryData();
    });


    /**
     * 获取薪资套列表
     */
    function getSkypayGroups() {
        var html = "";
        $.ajax({
            async: false,
            url: ctx + "salaryCalculation/getSkypayGroups",
            data: {},
            type: "post",
            dataType: "json",
            success: function (data) {
                $("#pgid").empty();
                var arry = data;
                for (var i = 0; i < arry.length; i++) {
                    xztList.push({value: arry[i].id, text: arry[i].title});
                    html += "<option value='"
                        + arry[i].id
                        + "'>"
                        + arry[i].title
                        + "</option>";
                }
                $("#pgid").append(html);
                $("#modal1").click();
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert("错误,请联系管理员,错误信息:" + textStatus);
            }
        });
    }

    function getPgid() {
        pgid = $("#pgid").val();
        $("#missmodal1").click();
        getData();
    }

    function getData() {
        var columns = [];
        var other;
        var badge = {field: 'badge', title: '工号'};
        var name = {field: 'name', title: '姓名'};
        var compName = {field: 'compName', title: '公司'};
        var depName = {field: 'depName', title: '部门名称'};
        var jobName = {field: 'jobName', title: '岗位'};
        var bcid = {field: 'bcid', title: '银行'};
        var type = {field: 'type', title: '银行类别'};
        var bccard = {field: 'bccard', title: '银行卡号'};
        var sf = {field: 'sf', title: '省'};
        var s = {field: 's', title: '市'};
        var ylh = {field: 'ylh', title: '银联号'};
        var yhmc = {field: 'yhmc', title: '银行名称'};
        var isth = {field: 'isth', title: '是否同行'};
        var istc = {field: 'istc', title: '是否同城'};
        columns.push(badge, name, compName, depName, jobName, bcid, type, bccard, sf, s, ylh, yhmc, isth, istc);
        var options = {
            code: "id",
            uniqueId: "id",
            url: prefix + "/list?pgid=" + pgid,
            height: $(window).height() - 120,
            modalName: "福利流程",
            columns: columns
        };
        $.table.init(options);
    }

    function bankNumRepeatValidation(){
        $.operate.eject_window("身份证重复验证", prefix + "/bankNumRepeatValidation", "xiao");

    }
</script>
</body>
</html>
